package com.library.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 书籍实体类
 *
 * @author Library Team
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_book")
public class Book implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 书籍ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 书籍标题
     */
    @TableField("title")
    private String title;

    /**
     * 作者
     */
    @TableField("author")
    private String author;

    /**
     * 出版社
     */
    @TableField("publisher")
    private String publisher;

    /**
     * 出版日期
     */
    @TableField("publish_date")
    private String publishDate;

    /**
     * ISBN编号
     */
    @TableField("isbn")
    private String isbn;

    /**
     * 书籍分类：LITERATURE-文学，TECHNOLOGY-科技，HISTORY-历史，ART-艺术，OTHER-其他
     */
    @TableField("category")
    private String category;

    /**
     * 书籍描述
     */
    @TableField("description")
    private String description;

    /**
     * 封面图片路径
     */
    @TableField("cover_image")
    private String coverImage;

    /**
     * 总库存数量
     */
    @TableField("total_quantity")
    private Integer totalQuantity;

    /**
     * 可借数量
     */
    @TableField("available_quantity")
    private Integer availableQuantity;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    /**
     * 逻辑删除标记：1-已删除，0-未删除
     */
    @TableLogic
    @TableField("deleted")
    private Integer deleted;
}
